"""Test Secure Controller"""
from pydive.lib.base import BaseController
from tg import expose, flash
from pylons.i18n import ugettext as _
#from tg import redirect, validate
#from pydive.model import DBSession, metadata
#from dbsprockets.dbmechanic.frameworks.tg2 import DBMechanic
#from dbsprockets.saprovider import SAProvider
from repoze.what.predicates import has_permission
from pydive.model import DBSession, metadata
from pydive.model.dive import DiveSite
import logging
log = logging.getLogger(__name__)



class SitesController(BaseController):
    """REST Controller styled on the Atom Publishing Protocol"""
    # To properly map this controller, ensure your config/routing.py file has
    # a resource setup:
    #     map.resource('site', 'sites')

    @expose("pydive.templates.sites.index")
    def index(self):
        log.debug("jestem")
        return dict()
    
    def create(self):
        """POST /sites: Create a new item."""
        # url('sites')
        pass
    
    @expose("pydive.templates.sites.new")
    def new(self):
        return dict()

    def update(self, id):
        """PUT /sites/id: Update an existing item."""
        # Forms posted to this method should contain a hidden field:
        #    <input type="hidden" name="_method" value="PUT" />
        # Or using helpers:
        #    h.form(url('site', id=ID),
        #           method='put')
        # url('site', id=ID)
        pass

    def delete(self, id):
        """DELETE /sites/id: Delete an existing item."""
        # Forms posted to this method should contain a hidden field:
        #    <input type="hidden" name="_method" value="DELETE" />
        # Or using helpers:
        #    h.form(url('site', id=ID),
        #           method='delete')
        # url('site', id=ID)
        pass

    def show(self, id, format='html'):
        """GET /sites/id: Show a specific item."""
        # url('site', id=ID)
        pass

    def edit(self, id, format='html'):
        """GET /sites/id/edit: Form to edit an existing item."""
        # url('edit_site', id=ID)
        pass
